home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1998 #4
/
Amiga Plus CD - 1998 - No. 4.iso
/
pd
/
programmierung
/
efmuilib
/
examples
/
eflistmulti.asc
< prev
next >
Wrap
Text File
|
1998-02-03
|
5KB
|
152 lines
;******************************************
;* EFListMulti.asc *
;* ~~~~~~~~~~~~~~~ *
;* Shows how to use a multi-columns list. *
;******************************************
;
;(C)opyRight 1998 by Vivid Imagination
NEWTYPE.en ;This NEWTYPE is used
*entrie.b[3] ;to get the entries
End NEWTYPE ;
DEFTYPE.en *buf
DEFTYPE.l
Dim *en.b(40) ;*en() contains the pointers to ALL entries
Dim *entr.b(15) ;*entr() contains the pointers for each line
Dim *en2.b(40) ;This the second
Dim *entr2.b(15) ;arrays of entries
n=0
For i=0 To 30 Step 3 ;We create pointers
For j=0 To 2 ;to our entries
*en(i+j)=Null("Coords : ("+Str$(j+1)+","+Str$(n+1)+")") ;There is no other
*en2(i+j)=Null("A second list! ("+Str$(j+1)+","+Str$(n+1)+")")
Next ;proper way of doing
*entr(n)=&*en(i) ;multi-columns
*entr2(n)=&*en2(i)
n+1
Next
MUIApplicationTitle "EFListMulti"
MUIApplicationVersion "$VER: EFListMulti 1.0 (02.03.98)"
MUIApplicationCopyright "(c)1998, Vivid Imagination"
MUIApplicationAuthor "Erwan Fouret"
MUIApplicationDescription "An example of Multi-columns list."
MUIApplicationBase "EFLISTMULTI"
MUIListHook On
MUIAddTags 1,#MUIA_Frame,#MUIV_Frame_InputList
MUIAddTags 1,#MUIA_List_ShowDropMarks,1 ;This lines must be
MUIAddTags 1,#MUIA_List_DragSortable,1 ;removed if you don't
MUIAddTags 2,#MUIA_Listview_DragType,#MUIV_Listview_DragType_Immediate ;want Drag'n'Drop
MUIList 1,"BAR,BAR,",*entr()
MUIListView 2,1
MUIAddTags 3,#MUIA_String_AttachedList,MUIObjLoc(2) ;<- This tag allows you
MUIString 3,"",100 ;to use cursor keys to
;browse the list when a
MUIAddTags 4,#MUIA_String_AttachedList,MUIObjLoc(2) ;String gadget is selected
MUIString 4,"",100
MUIAddTags 5,#MUIA_String_AttachedList,MUIObjLoc(2)
MUIString 5,"",100
MUISimpleButton 6,"_Clear"
MUISimpleButton 7,"_Change"
MUISimpleButton 8,"_Quit"
MUIAddObjsHGroup 0,3,4,5
MUICreateHGroup 0
MUIAddObjsHGroup 9,6,7,8
MUICreateHGroup 9
MUIAddObjsVGroup 10,2,0,9
MUICreateVGroup 10
MUICreateWindow 11,"EFListMulti","EFLM",10
MUIAddSubWindow 11
If MUICreateApplication<>True Then End
MUINotifyApp 1,#MUIA_List_Active,#MUIV_EveryTime,1
MUINotifyApp 3,#MUIA_String_Contents,#MUIV_EveryTime,3
MUINotifyApp 4,#MUIA_String_Contents,#MUIV_EveryTime,4
MUINotifyApp 5,#MUIA_String_Contents,#MUIV_EveryTime,5
MUINotifyApp 6,#MUIA_Pressed,0,6
MUINotifyApp 7,#MUIA_Pressed,0,7
MUINotifyApp 8,#MUIA_Pressed,0,-1
MUINotifyApp 11,#MUIA_Window_CloseRequest,1,-1
MUIOpenWindow 11
ls=1 ;the acual list set is *en (=>1)
Repeat
ev.l=MUIWaitEvent
Select ev
Case 1
MUIDoMethod 1,#MUIM_List_GetEntry,#MUIV_List_GetEntry_Active,&*buf
MUISet 3,#MUIA_String_Contents,*buf\entrie[0]
MUISet 4,#MUIA_String_Contents,*buf\entrie[1]
MUISet 5,#MUIA_String_Contents,*buf\entrie[2]
Case 3
If ls>0
act=MUIGet(1,#MUIA_List_Active)
*str=MUIGet(3,#MUIA_String_Contents)
If ls=1
*en((act)*3)=Null(Peek$(*str))
Else
*en2((act)*3)=Null(Peek$(*str))
EndIf
MUIRedrawSingle 2,act
EndIf
Case 4
If ls>0
act=MUIGet(1,#MUIA_List_Active)
*str=MUIGet(4,#MUIA_String_Contents)
If ls=1
*en((act)*3+1)=Null(Peek$(*str))
Else
*en2((act)*3+1)=Null(Peek$(*str))
EndIf
MUIRedrawSingle 2,act
EndIf
Case 5
If ls>0
act=MUIGet(1,#MUIA_List_Active)
*str=MUIGet(5,#MUIA_String_Contents)
If ls=1
*en((act)*3+2)=Null(Peek$(*str))
Else
*en2((act)*3+2)=Null(Peek$(*str))
EndIf
MUIRedrawSingle 2,act
EndIf
Case 6
MUIChangeList 1 ;Clear the list
ls=-1
MUISet 3,#MUIA_String_Contents,Null(" ")
MUISet 4,#MUIA_String_Contents,Null(" ")
MUISet 5,#MUIA_String_Contents,Null(" ")
Case 7
MUIChangeList 1,*entr2(),#MUIV_List_Insert_Bottom ;Replace the old list
ls=2
MUIDoMethod 1,#MUIM_List_GetEntry,#MUIV_List_GetEntry_Active,&*buf
MUISet 3,#MUIA_String_Contents,*buf\entrie[0]
MUISet 4,#MUIA_String_Contents,*buf\entrie[1]
MUISet 5,#MUIA_String_Contents,*buf\entrie[2]
MUISet 1,#MUIA_List_Active,#MUIV_List_Active_Top
End Select
Until ev=-1
MUICloseWindow 11
End